<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.18"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>embedme: libemb::File Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Logo" src="logo.png"/></td>
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">embedme
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.18 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'Search');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
/* @license-end */</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><b>libemb</b></li><li class="navelem"><a class="el" href="classlibemb_1_1_file.html">File</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="summary">
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="#pub-static-methods">Static Public Member Functions</a> &#124;
<a href="classlibemb_1_1_file-members.html">List of all members</a>  </div>
  <div class="headertitle">
<div class="title">libemb::File Class Reference</div>  </div>
</div><!--header-->
<div class="contents">

<p>文件类  
 <a href="classlibemb_1_1_file.html#details">More...</a></p>

<p><code>#include &lt;<a class="el" href="_file_util_8h_source.html">FileUtil.h</a>&gt;</code></p>
<div class="dynheader">
Inheritance diagram for libemb::File:</div>
<div class="dyncontent">
 <div class="center">
  <img src="classlibemb_1_1_file.png" usemap="#libemb::File_map" alt=""/>
  <map id="libemb::File_map" name="libemb::File_map">
<area href="classlibemb_1_1_i_o_device.html" title="IO设备抽象类" alt="libemb::IODevice" shape="rect" coords="0,0,107,24"/>
  </map>
</div></div>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:a1d4b5f9a06ca72df660cb68fa73863b7"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classlibemb_1_1_file.html#a1d4b5f9a06ca72df660cb68fa73863b7">isOpen</a> ()</td></tr>
<tr class="memdesc:a1d4b5f9a06ca72df660cb68fa73863b7"><td class="mdescLeft">&#160;</td><td class="mdescRight">判断文件是否打开  <a href="classlibemb_1_1_file.html#a1d4b5f9a06ca72df660cb68fa73863b7">More...</a><br /></td></tr>
<tr class="separator:a1d4b5f9a06ca72df660cb68fa73863b7"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a9771cd41ba96ec1f80f66b8978a22c50"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classlibemb_1_1_file.html#a9771cd41ba96ec1f80f66b8978a22c50">open</a> (const std::string &amp;fileName, int ioMode) override</td></tr>
<tr class="memdesc:a9771cd41ba96ec1f80f66b8978a22c50"><td class="mdescLeft">&#160;</td><td class="mdescRight">打开文件(继承自IODevice)  <a href="classlibemb_1_1_file.html#a9771cd41ba96ec1f80f66b8978a22c50">More...</a><br /></td></tr>
<tr class="separator:a9771cd41ba96ec1f80f66b8978a22c50"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a4f247c046f864633a94d223dc749cdc1"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classlibemb_1_1_file.html#a4f247c046f864633a94d223dc749cdc1">close</a> () override</td></tr>
<tr class="memdesc:a4f247c046f864633a94d223dc749cdc1"><td class="mdescLeft">&#160;</td><td class="mdescRight">关闭文件(继承自IODevice)  <a href="classlibemb_1_1_file.html#a4f247c046f864633a94d223dc749cdc1">More...</a><br /></td></tr>
<tr class="separator:a4f247c046f864633a94d223dc749cdc1"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a1e78f16a86200306a281cfb70bccb737"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classlibemb_1_1_file.html#a1e78f16a86200306a281cfb70bccb737">readData</a> (char *buf, int len) override</td></tr>
<tr class="memdesc:a1e78f16a86200306a281cfb70bccb737"><td class="mdescLeft">&#160;</td><td class="mdescRight">读取文件(继承自IODevice)  <a href="classlibemb_1_1_file.html#a1e78f16a86200306a281cfb70bccb737">More...</a><br /></td></tr>
<tr class="separator:a1e78f16a86200306a281cfb70bccb737"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ada78faccf08c9835b8043909246eefd2"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classlibemb_1_1_file.html#ada78faccf08c9835b8043909246eefd2">writeData</a> (const char *buf, int len) override</td></tr>
<tr class="memdesc:ada78faccf08c9835b8043909246eefd2"><td class="mdescLeft">&#160;</td><td class="mdescRight">写入文件(继承自IODevice)  <a href="classlibemb_1_1_file.html#ada78faccf08c9835b8043909246eefd2">More...</a><br /></td></tr>
<tr class="separator:ada78faccf08c9835b8043909246eefd2"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ae444196ae3bf95c403c039e97935f7ae"><td class="memItemLeft" align="right" valign="top">void *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classlibemb_1_1_file.html#ae444196ae3bf95c403c039e97935f7ae">mapMemory</a> ()</td></tr>
<tr class="memdesc:ae444196ae3bf95c403c039e97935f7ae"><td class="mdescLeft">&#160;</td><td class="mdescRight">将文件映射到内存  <a href="classlibemb_1_1_file.html#ae444196ae3bf95c403c039e97935f7ae">More...</a><br /></td></tr>
<tr class="separator:ae444196ae3bf95c403c039e97935f7ae"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a6a97e74313c5d2ac43865ed8e1a8f0be"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classlibemb_1_1_file.html#a6a97e74313c5d2ac43865ed8e1a8f0be">unmapMemory</a> ()</td></tr>
<tr class="memdesc:a6a97e74313c5d2ac43865ed8e1a8f0be"><td class="mdescLeft">&#160;</td><td class="mdescRight">取消内存映射  <a href="classlibemb_1_1_file.html#a6a97e74313c5d2ac43865ed8e1a8f0be">More...</a><br /></td></tr>
<tr class="separator:a6a97e74313c5d2ac43865ed8e1a8f0be"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a3091e085800e4f547f78ceef93b7c356"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classlibemb_1_1_file.html#a3091e085800e4f547f78ceef93b7c356">readLine</a> (std::string &amp;lineStr)</td></tr>
<tr class="memdesc:a3091e085800e4f547f78ceef93b7c356"><td class="mdescLeft">&#160;</td><td class="mdescRight">读取一行  <a href="classlibemb_1_1_file.html#a3091e085800e4f547f78ceef93b7c356">More...</a><br /></td></tr>
<tr class="separator:a3091e085800e4f547f78ceef93b7c356"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:af7123e19d329a0089225188ef50587cf"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classlibemb_1_1_file.html#af7123e19d329a0089225188ef50587cf">getSize</a> ()</td></tr>
<tr class="memdesc:af7123e19d329a0089225188ef50587cf"><td class="mdescLeft">&#160;</td><td class="mdescRight">获取文件大小  <a href="classlibemb_1_1_file.html#af7123e19d329a0089225188ef50587cf">More...</a><br /></td></tr>
<tr class="separator:af7123e19d329a0089225188ef50587cf"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a319d3f945b457eebdc5c2598a0927f9f"><td class="memItemLeft" align="right" valign="top">std::string&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classlibemb_1_1_file.html#a319d3f945b457eebdc5c2598a0927f9f">getName</a> ()</td></tr>
<tr class="memdesc:a319d3f945b457eebdc5c2598a0927f9f"><td class="mdescLeft">&#160;</td><td class="mdescRight">获取文件名称  <a href="classlibemb_1_1_file.html#a319d3f945b457eebdc5c2598a0927f9f">More...</a><br /></td></tr>
<tr class="separator:a319d3f945b457eebdc5c2598a0927f9f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a2293dfa48cfa9e46ed9b8a461803c8b4"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classlibemb_1_1_file.html#a2293dfa48cfa9e46ed9b8a461803c8b4">isEnd</a> ()</td></tr>
<tr class="memdesc:a2293dfa48cfa9e46ed9b8a461803c8b4"><td class="mdescLeft">&#160;</td><td class="mdescRight">是否到文件结尾  <a href="classlibemb_1_1_file.html#a2293dfa48cfa9e46ed9b8a461803c8b4">More...</a><br /></td></tr>
<tr class="separator:a2293dfa48cfa9e46ed9b8a461803c8b4"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:acf216973cef1b72f9c9db94d6d1d7dfe"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classlibemb_1_1_file.html#acf216973cef1b72f9c9db94d6d1d7dfe">getPos</a> ()</td></tr>
<tr class="memdesc:acf216973cef1b72f9c9db94d6d1d7dfe"><td class="mdescLeft">&#160;</td><td class="mdescRight">获取当前读写位置  <a href="classlibemb_1_1_file.html#acf216973cef1b72f9c9db94d6d1d7dfe">More...</a><br /></td></tr>
<tr class="separator:acf216973cef1b72f9c9db94d6d1d7dfe"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ae1db1db7933ba28a07468118c1d0c1e7"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classlibemb_1_1_file.html#ae1db1db7933ba28a07468118c1d0c1e7">setPos</a> (int pos)</td></tr>
<tr class="memdesc:ae1db1db7933ba28a07468118c1d0c1e7"><td class="mdescLeft">&#160;</td><td class="mdescRight">设置当前读写位置  <a href="classlibemb_1_1_file.html#ae1db1db7933ba28a07468118c1d0c1e7">More...</a><br /></td></tr>
<tr class="separator:ae1db1db7933ba28a07468118c1d0c1e7"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="inherit_header pub_methods_classlibemb_1_1_i_o_device"><td colspan="2" onclick="javascript:toggleInherit('pub_methods_classlibemb_1_1_i_o_device')"><img src="closed.png" alt="-"/>&#160;Public Member Functions inherited from <a class="el" href="classlibemb_1_1_i_o_device.html">libemb::IODevice</a></td></tr>
<tr class="memitem:ae3510f12e4bc5bcea11f2328534feebc inherit pub_methods_classlibemb_1_1_i_o_device"><td class="memItemLeft" align="right" valign="top">virtual int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classlibemb_1_1_i_o_device.html#ae3510f12e4bc5bcea11f2328534feebc">recvData</a> (char *buf, int len, int usTimeout=-1)</td></tr>
<tr class="memdesc:ae3510f12e4bc5bcea11f2328534feebc inherit pub_methods_classlibemb_1_1_i_o_device"><td class="mdescLeft">&#160;</td><td class="mdescRight">接收数据  <a href="classlibemb_1_1_i_o_device.html#ae3510f12e4bc5bcea11f2328534feebc">More...</a><br /></td></tr>
<tr class="separator:ae3510f12e4bc5bcea11f2328534feebc inherit pub_methods_classlibemb_1_1_i_o_device"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a2d917acb7ad2f18e1fe8cecba124de2d inherit pub_methods_classlibemb_1_1_i_o_device"><td class="memItemLeft" align="right" valign="top">virtual int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classlibemb_1_1_i_o_device.html#a2d917acb7ad2f18e1fe8cecba124de2d">sendData</a> (const char *buf, int len, int usTimeout=-1)</td></tr>
<tr class="memdesc:a2d917acb7ad2f18e1fe8cecba124de2d inherit pub_methods_classlibemb_1_1_i_o_device"><td class="mdescLeft">&#160;</td><td class="mdescRight">发送数据  <a href="classlibemb_1_1_i_o_device.html#a2d917acb7ad2f18e1fe8cecba124de2d">More...</a><br /></td></tr>
<tr class="separator:a2d917acb7ad2f18e1fe8cecba124de2d inherit pub_methods_classlibemb_1_1_i_o_device"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:abe8326c262b8eb210d41f8cd1f00102b inherit pub_methods_classlibemb_1_1_i_o_device"><td class="memItemLeft" align="right" valign="top">virtual int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classlibemb_1_1_i_o_device.html#abe8326c262b8eb210d41f8cd1f00102b">setAttribute</a> (int attr, int value)</td></tr>
<tr class="memdesc:abe8326c262b8eb210d41f8cd1f00102b inherit pub_methods_classlibemb_1_1_i_o_device"><td class="mdescLeft">&#160;</td><td class="mdescRight">设置属性  <a href="classlibemb_1_1_i_o_device.html#abe8326c262b8eb210d41f8cd1f00102b">More...</a><br /></td></tr>
<tr class="separator:abe8326c262b8eb210d41f8cd1f00102b inherit pub_methods_classlibemb_1_1_i_o_device"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a8e73b2bd9241b8958cc216157ed7bfef inherit pub_methods_classlibemb_1_1_i_o_device"><td class="memItemLeft" align="right" valign="top">virtual int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classlibemb_1_1_i_o_device.html#a8e73b2bd9241b8958cc216157ed7bfef">getAttribute</a> (int attr)</td></tr>
<tr class="memdesc:a8e73b2bd9241b8958cc216157ed7bfef inherit pub_methods_classlibemb_1_1_i_o_device"><td class="mdescLeft">&#160;</td><td class="mdescRight">获取属性值  <a href="classlibemb_1_1_i_o_device.html#a8e73b2bd9241b8958cc216157ed7bfef">More...</a><br /></td></tr>
<tr class="separator:a8e73b2bd9241b8958cc216157ed7bfef inherit pub_methods_classlibemb_1_1_i_o_device"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a81457fca59662cf3844ee79dff9b825e inherit pub_methods_classlibemb_1_1_i_o_device"><td class="memItemLeft" align="right" valign="top">virtual int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classlibemb_1_1_i_o_device.html#a81457fca59662cf3844ee79dff9b825e">fd</a> ()</td></tr>
<tr class="memdesc:a81457fca59662cf3844ee79dff9b825e inherit pub_methods_classlibemb_1_1_i_o_device"><td class="mdescLeft">&#160;</td><td class="mdescRight">获取设备描述符  <a href="classlibemb_1_1_i_o_device.html#a81457fca59662cf3844ee79dff9b825e">More...</a><br /></td></tr>
<tr class="separator:a81457fca59662cf3844ee79dff9b825e inherit pub_methods_classlibemb_1_1_i_o_device"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-static-methods"></a>
Static Public Member Functions</h2></td></tr>
<tr class="memitem:af8490db474f02342d555f1cbd9e372bd"><td class="memItemLeft" align="right" valign="top">static bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classlibemb_1_1_file.html#af8490db474f02342d555f1cbd9e372bd">exists</a> (const std::string &amp;fileName)</td></tr>
<tr class="memdesc:af8490db474f02342d555f1cbd9e372bd"><td class="mdescLeft">&#160;</td><td class="mdescRight">判断文件是否存在  <a href="classlibemb_1_1_file.html#af8490db474f02342d555f1cbd9e372bd">More...</a><br /></td></tr>
<tr class="separator:af8490db474f02342d555f1cbd9e372bd"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a50066f3d3393111bf9dc9fb02d0a7037"><td class="memItemLeft" align="right" valign="top">static int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classlibemb_1_1_file.html#a50066f3d3393111bf9dc9fb02d0a7037">getSize</a> (const std::string &amp;fileName)</td></tr>
<tr class="memdesc:a50066f3d3393111bf9dc9fb02d0a7037"><td class="mdescLeft">&#160;</td><td class="mdescRight">获取文件大小  <a href="classlibemb_1_1_file.html#a50066f3d3393111bf9dc9fb02d0a7037">More...</a><br /></td></tr>
<tr class="separator:a50066f3d3393111bf9dc9fb02d0a7037"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a245b1a78947afee45c39741a291519b1"><td class="memItemLeft" align="right" valign="top">static bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classlibemb_1_1_file.html#a245b1a78947afee45c39741a291519b1">removeFile</a> (const std::string &amp;fileName)</td></tr>
<tr class="memdesc:a245b1a78947afee45c39741a291519b1"><td class="mdescLeft">&#160;</td><td class="mdescRight">删除文件  <a href="classlibemb_1_1_file.html#a245b1a78947afee45c39741a291519b1">More...</a><br /></td></tr>
<tr class="separator:a245b1a78947afee45c39741a291519b1"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ac00f9fc96d3c4183be9bbfd65f6a3c6a"><td class="memItemLeft" align="right" valign="top">static bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classlibemb_1_1_file.html#ac00f9fc96d3c4183be9bbfd65f6a3c6a">renameFile</a> (const std::string &amp;oldFile, const std::string &amp;newFile)</td></tr>
<tr class="memdesc:ac00f9fc96d3c4183be9bbfd65f6a3c6a"><td class="mdescLeft">&#160;</td><td class="mdescRight">重命名文件  <a href="classlibemb_1_1_file.html#ac00f9fc96d3c4183be9bbfd65f6a3c6a">More...</a><br /></td></tr>
<tr class="separator:ac00f9fc96d3c4183be9bbfd65f6a3c6a"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="inherited"></a>
Additional Inherited Members</h2></td></tr>
<tr class="inherit_header pro_attribs_classlibemb_1_1_i_o_device"><td colspan="2" onclick="javascript:toggleInherit('pro_attribs_classlibemb_1_1_i_o_device')"><img src="closed.png" alt="-"/>&#160;Protected Attributes inherited from <a class="el" href="classlibemb_1_1_i_o_device.html">libemb::IODevice</a></td></tr>
<tr class="memitem:a7bca9ab1fd0062d471914cd1c36a774c inherit pro_attribs_classlibemb_1_1_i_o_device"><td class="memItemLeft" align="right" valign="top"><a id="a7bca9ab1fd0062d471914cd1c36a774c"></a>
int&#160;</td><td class="memItemRight" valign="bottom"><b>m_fd</b> {-1}</td></tr>
<tr class="separator:a7bca9ab1fd0062d471914cd1c36a774c inherit pro_attribs_classlibemb_1_1_i_o_device"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:adeadda7c8692c9fd171a66809fbcf4af inherit pro_attribs_classlibemb_1_1_i_o_device"><td class="memItemLeft" align="right" valign="top"><a id="adeadda7c8692c9fd171a66809fbcf4af"></a>
int&#160;</td><td class="memItemRight" valign="bottom"><b>m_openMode</b> {-1}</td></tr>
<tr class="separator:adeadda7c8692c9fd171a66809fbcf4af inherit pro_attribs_classlibemb_1_1_i_o_device"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa5c6a7e2f7158141ef006a942ded96f3 inherit pro_attribs_classlibemb_1_1_i_o_device"><td class="memItemLeft" align="right" valign="top"><a id="aa5c6a7e2f7158141ef006a942ded96f3"></a>
std::string&#160;</td><td class="memItemRight" valign="bottom"><b>m_devName</b> {&quot;&quot;}</td></tr>
<tr class="separator:aa5c6a7e2f7158141ef006a942ded96f3 inherit pro_attribs_classlibemb_1_1_i_o_device"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>文件类 </p>
</div><h2 class="groupheader">Member Function Documentation</h2>
<a id="a4f247c046f864633a94d223dc749cdc1"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a4f247c046f864633a94d223dc749cdc1">&#9670;&nbsp;</a></span>close()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">bool libemb::File::close </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">override</span><span class="mlabel">virtual</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>关闭文件(继承自IODevice) </p>
<dl class="section return"><dt>Returns</dt><dd>true </dd>
<dd>
false </dd></dl>

<p>Reimplemented from <a class="el" href="classlibemb_1_1_i_o_device.html#a14794dab8323c4850c9512b3a7d41335">libemb::IODevice</a>.</p>

</div>
</div>
<a id="af8490db474f02342d555f1cbd9e372bd"></a>
<h2 class="memtitle"><span class="permalink"><a href="#af8490db474f02342d555f1cbd9e372bd">&#9670;&nbsp;</a></span>exists()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">bool libemb::File::exists </td>
          <td>(</td>
          <td class="paramtype">const std::string &amp;&#160;</td>
          <td class="paramname"><em>fileName</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>判断文件是否存在 </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">fileName</td><td>文件名 </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>true 文件存在 </dd>
<dd>
false 文件不存在(如果fileName是目录也返回false) </dd></dl>

</div>
</div>
<a id="a319d3f945b457eebdc5c2598a0927f9f"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a319d3f945b457eebdc5c2598a0927f9f">&#9670;&nbsp;</a></span>getName()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">std::string libemb::File::getName </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>获取文件名称 </p>
<dl class="section return"><dt>Returns</dt><dd>std::string </dd></dl>

</div>
</div>
<a id="acf216973cef1b72f9c9db94d6d1d7dfe"></a>
<h2 class="memtitle"><span class="permalink"><a href="#acf216973cef1b72f9c9db94d6d1d7dfe">&#9670;&nbsp;</a></span>getPos()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int libemb::File::getPos </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>获取当前读写位置 </p>
<dl class="section return"><dt>Returns</dt><dd>int </dd></dl>

</div>
</div>
<a id="af7123e19d329a0089225188ef50587cf"></a>
<h2 class="memtitle"><span class="permalink"><a href="#af7123e19d329a0089225188ef50587cf">&#9670;&nbsp;</a></span>getSize() <span class="overload">[1/2]</span></h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int libemb::File::getSize </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>获取文件大小 </p>
<dl class="section return"><dt>Returns</dt><dd>int </dd></dl>

</div>
</div>
<a id="a50066f3d3393111bf9dc9fb02d0a7037"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a50066f3d3393111bf9dc9fb02d0a7037">&#9670;&nbsp;</a></span>getSize() <span class="overload">[2/2]</span></h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">int libemb::File::getSize </td>
          <td>(</td>
          <td class="paramtype">const std::string &amp;&#160;</td>
          <td class="paramname"><em>fileName</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>获取文件大小 </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">fileName</td><td></td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>int </dd></dl>

</div>
</div>
<a id="a2293dfa48cfa9e46ed9b8a461803c8b4"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a2293dfa48cfa9e46ed9b8a461803c8b4">&#9670;&nbsp;</a></span>isEnd()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool libemb::File::isEnd </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>是否到文件结尾 </p>
<dl class="section return"><dt>Returns</dt><dd>true </dd>
<dd>
false </dd></dl>

</div>
</div>
<a id="a1d4b5f9a06ca72df660cb68fa73863b7"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a1d4b5f9a06ca72df660cb68fa73863b7">&#9670;&nbsp;</a></span>isOpen()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">bool libemb::File::isOpen </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">virtual</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>判断文件是否打开 </p>
<dl class="section return"><dt>Returns</dt><dd>true </dd>
<dd>
false </dd></dl>

<p>Reimplemented from <a class="el" href="classlibemb_1_1_i_o_device.html#aa91aa91ca082dcd90b3c21b5fdcbe2c6">libemb::IODevice</a>.</p>

</div>
</div>
<a id="ae444196ae3bf95c403c039e97935f7ae"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ae444196ae3bf95c403c039e97935f7ae">&#9670;&nbsp;</a></span>mapMemory()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void * libemb::File::mapMemory </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>将文件映射到内存 </p>
<dl class="section return"><dt>Returns</dt><dd>void* 内存地址 </dd></dl>

</div>
</div>
<a id="a9771cd41ba96ec1f80f66b8978a22c50"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a9771cd41ba96ec1f80f66b8978a22c50">&#9670;&nbsp;</a></span>open()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">bool libemb::File::open </td>
          <td>(</td>
          <td class="paramtype">const std::string &amp;&#160;</td>
          <td class="paramname"><em>fileName</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>ioMode</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">override</span><span class="mlabel">virtual</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>打开文件(继承自IODevice) </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">fileName</td><td>文件名 </td></tr>
    <tr><td class="paramname">ioMode</td><td>IO_MODE_E </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>true </dd>
<dd>
false </dd></dl>

<p>Reimplemented from <a class="el" href="classlibemb_1_1_i_o_device.html#a41072f54003d47e1e1517958605b1e46">libemb::IODevice</a>.</p>

</div>
</div>
<a id="a1e78f16a86200306a281cfb70bccb737"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a1e78f16a86200306a281cfb70bccb737">&#9670;&nbsp;</a></span>readData()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">int libemb::File::readData </td>
          <td>(</td>
          <td class="paramtype">char *&#160;</td>
          <td class="paramname"><em>buf</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>len</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">override</span><span class="mlabel">virtual</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>读取文件(继承自IODevice) </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">buf</td><td></td></tr>
    <tr><td class="paramname">len</td><td></td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>int 读取数据的长度,读取失败返回-1 </dd></dl>

<p>Reimplemented from <a class="el" href="classlibemb_1_1_i_o_device.html#ae72ace3efe7f7fffbea691cab647850b">libemb::IODevice</a>.</p>

</div>
</div>
<a id="a3091e085800e4f547f78ceef93b7c356"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a3091e085800e4f547f78ceef93b7c356">&#9670;&nbsp;</a></span>readLine()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int libemb::File::readLine </td>
          <td>(</td>
          <td class="paramtype">std::string &amp;&#160;</td>
          <td class="paramname"><em>lineStr</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>读取一行 </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">lineStr</td><td></td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>int </dd></dl>

</div>
</div>
<a id="a245b1a78947afee45c39741a291519b1"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a245b1a78947afee45c39741a291519b1">&#9670;&nbsp;</a></span>removeFile()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">bool libemb::File::removeFile </td>
          <td>(</td>
          <td class="paramtype">const std::string &amp;&#160;</td>
          <td class="paramname"><em>fileName</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>删除文件 </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">fileName</td><td></td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>true </dd>
<dd>
false </dd></dl>

</div>
</div>
<a id="ac00f9fc96d3c4183be9bbfd65f6a3c6a"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ac00f9fc96d3c4183be9bbfd65f6a3c6a">&#9670;&nbsp;</a></span>renameFile()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">bool libemb::File::renameFile </td>
          <td>(</td>
          <td class="paramtype">const std::string &amp;&#160;</td>
          <td class="paramname"><em>oldFile</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const std::string &amp;&#160;</td>
          <td class="paramname"><em>newFile</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>重命名文件 </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">oldFile</td><td></td></tr>
    <tr><td class="paramname">newFile</td><td></td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>true </dd>
<dd>
false </dd></dl>

</div>
</div>
<a id="ae1db1db7933ba28a07468118c1d0c1e7"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ae1db1db7933ba28a07468118c1d0c1e7">&#9670;&nbsp;</a></span>setPos()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int libemb::File::setPos </td>
          <td>(</td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>pos</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>设置当前读写位置 </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">pos</td><td></td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>int </dd></dl>

</div>
</div>
<a id="a6a97e74313c5d2ac43865ed8e1a8f0be"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a6a97e74313c5d2ac43865ed8e1a8f0be">&#9670;&nbsp;</a></span>unmapMemory()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool libemb::File::unmapMemory </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>取消内存映射 </p>
<dl class="section return"><dt>Returns</dt><dd>true </dd>
<dd>
false </dd></dl>

</div>
</div>
<a id="ada78faccf08c9835b8043909246eefd2"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ada78faccf08c9835b8043909246eefd2">&#9670;&nbsp;</a></span>writeData()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">int libemb::File::writeData </td>
          <td>(</td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>buf</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>len</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">override</span><span class="mlabel">virtual</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>写入文件(继承自IODevice) </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">buf</td><td></td></tr>
    <tr><td class="paramname">len</td><td></td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>int 写入数据的长度,写入失败返回-1 </dd></dl>

<p>Reimplemented from <a class="el" href="classlibemb_1_1_i_o_device.html#a9cde5b2c2a0d1157bc818148ecafbe32">libemb::IODevice</a>.</p>

</div>
</div>
<hr/>The documentation for this class was generated from the following files:<ul>
<li>src/<a class="el" href="_file_util_8h_source.html">FileUtil.h</a></li>
<li>src/FileUtil.cpp</li>
</ul>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.18
</small></address>
</body>
</html>
